package jonggyuni.basic;

public class Ch04_Q1_pr {

	public static void main(String[] args) {
		
		Songs sg = new Songs();
		
		sg.setTitle("Dancing Queeen");
		sg.setArtist("ABBA");
		sg.setAlbum("Arrival");
		sg.setComposer(new String[]{"베니 안데르손","비에른 올바에우스", "스틱앤더슨"});
		sg.setYear(1976);
		sg.setTrack(2);
		
		System.out.println(sg.toString());

	}//main

}//class


class Songs{
	private String title;
	private String artist;
	private String album;
	private String composer[];
	private int year;
	private int track; 
	
	public Songs(){}//기본생성자.
	
	//set
	public void setTitle(String title){
		this.title = title;
	}
	
	public void setArtist(String artist){
		this.artist = artist;
	}
	
	public void setAlbum(String album){
		this.album = album;
	}
	
	public void setComposer(String composer[]){
		this.composer = composer;
	}
	
	public void setYear(int year){
		this.year = year;
	}
	
	public void setTrack(int track){
		this.track = track;
	}
	
	
	//get
	public String getTitle(){
		return title;
	}
	
	public String getArtist(){
		return artist;
	}
	
	public String getAlbum(){
		return album;
	}
	
	public String[] getComposer(){
		return composer;
	}
	
	public int getYear(){
		return year;
	}
	
	public int getTrack(){
		return track;
	}
	
	@Override
	public String toString() {
		String result="";
		result = result + "타이틀 : "+title+"\n";
		result = result + "아티스트 : "+artist+"\n";
		result = result + "엘범 : "+album+"\n";
		result = result + "작곡가 : ";
		for(int i=0;i<composer.length;i++){
			result = result + composer[i]+"/";	
		}
		result = result + "\n년도 : "+year+"\n";
		result = result + "트랙 : "+track+"\n";
		
		return result;
	}
	
}//class song









